<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>
    function myAjax(method,url,callback){
        var xhr = new XMLHttpRequest();
        xhr.onload = function(){
           callback(JSON.parse(xhr.responseText))
        };
        xhr.open(method, url,true);
        xhr.send()
    }

    myAjax("get","https://api.apiopen.top/getJoke?page=1&count=2&type=video",function (res) {
        console.log(res)
    })

</script>

</body>
</html>
